package app.netant.finishbook.x555;

import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

import app.netant.book.base.BaseDetail;
import app.netant.book.base.BaseEntity;
import app.netant.book.base.BasePage;
import cn.lily.com.enviroment.Enviroment;

public class X555Page extends BasePage {

	public X555Page(String netSite) {
		super(netSite);
		this.tableKey = "x555";
		this.selectKey = ".d1 .down .xiazai .xiashu ul li.qq_g a";
		this.preHref = "http://www.555x.org";
	}

	@Override
	public String buildHref(Element element) {	
		String href = element.attr("href");
		if(href.startsWith("/")){
			href = this.preHref + href;
		}
		return href;
	}

	@Override
	public BaseEntity buildEntity() {
		return new X555Entity();
	}

	@Override
	public BaseDetail buildDetail(String href) {
		return new X555Detail(href);
	}

	@Override
	public void afterEntity(BaseEntity entity, Element element) {
		
	}
	
	public static void main(String[] args) {
		Enviroment.createEnv();
		Enviroment.getEnv().getLogBean().beginLog();
		X555Page page = new X555Page("http://www.555x.org/html/xuanhuan/");
		page.analyseHref();
	}
	
}
